<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>熙心健康体检系统</title>
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', sans-serif;
        }
       
        body {
            background-color: #f5f5f5;
        }
       
        /* 顶部黑色边框 */
        .header {
            background-color: #000;
            color: white;
            height: 60px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            position: sticky;
            top: 0;
            z-index: 100;
        }
       
        .header-title {
            font-size: 20px;
            font-weight: bold;
        }
       
        .admin-area {
            display: flex;
            align-items: center;
        }
       
        .admin-name {
            margin-right: 15px;
        }
    
        /* 修改为链接样式 */
        .logout-link {
            background-color: #ff0000;
            color: white;
            text-decoration: none;
            padding: 5px 10px;
            border-radius: 3px;
            display: inline-block;
        }
    
        .logout-link:hover {
            background-color: #cc0000;
        }
       
        /* 主体布局 */
        .container {
            display: flex;
            min-height: calc(100vh - 60px);
        }
       
        /* 左侧黑色边框导航 */
        .sidebar {
            width: 200px;
            background-color: #000;
            padding: 20px 0;
            position: sticky;
            top: 60px;
            height: calc(100vh - 60px);
            overflow-y: auto;
        }
       
        .nav-menu {
            list-style: none;
        }
       
        .nav-menu li {
            padding: 12px 20px;
        }
       
        .nav-menu a {
            color: white;
            text-decoration: none;
            display: block;
        }
       
        .nav-menu a:hover {
            color: #ddd;
        }
       
       
        .main-content {
            flex: 1;
            padding: 20px;
            background-color: #fff;
        }
       
        .content-section {
            margin-bottom: 30px;
        }
       
        .section-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
            padding-bottom: 5px;
            border-bottom: 2px solid #eee;
        }
       
        .chart-row {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-bottom: 20px;
        }
       
        .chart-box {
            border: 1px solid #ddd;
            padding: 15px;
            border-radius: 5px;
            background-color: #fff;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
       
        .chart-title {
            margin-top: 0;
            margin-bottom: 15px;
            font-size: 16px;
            text-align: center;
        }
       
        .chart-wrapper {
            position: relative;
            height: 300px;
            width: 100%;
        }
       
        .data-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 15px;
        }
       
        .data-table th, .data-table td {
            border: 1px solid #ddd;
            padding: 8px 12px;
            text-align: left;
        }
       
        .data-table th {
            background-color: #f2f2f2;
            font-weight: bold;
        }
    </style>
</head>
<body>
   <!-- 顶部黑色边框 -->
   <div class="header">
       <div class="header-title">熙心健康体检系统</div>
       <div class="admin-area">
           <span class="admin-name">系统管理员：admin</span>
           <!-- 修改为超链接 -->
           <a href="http://127.0.0.1:8848/xikangdemo1/team12/login.html" class="logout-link">OUT</a>
       </div>
   </div>
      
   <!-- 主体内容 -->
   <div class="container">
       <!-- 左侧黑色边框导航 -->
       <div class="sidebar">
           <ul class="nav-menu">
               <li><a href="http://127.0.0.1:8848/xikangdemo1/team12/shouye.html">首页</a></li>
               <li><a href="http://127.0.0.1:8848/xikangdemo1/team12/order.html">体检预约</a></li>
               <li><a href="http://127.0.0.1:8848/xikangdemo1/team12/orderlist.html">预约列表</a></li>
               <li><a href="http://127.0.0.1:8848/xikangdemo1/team12/binglidemo.html">体检客户查询</a></li>
           </ul>
       </div>
       
        <!-- 主内容区域 -->
        <div class="main-content">
            <!-- 体检报告表格 -->
            <div class="content-section">
                <h2 class="section-title">体检报告</h2>
                <table class="data-table">
                    <tr>
                        <th>项目</th>
                        <th>内容</th>
                    </tr>
                    <tr>
                        <td>体检报告</td>
                        <td>查看详细报告</td>
                    </tr>
                    <tr>
                        <td>我的诊断</td>
                        <td>诊断结果详情</td>
                    </tr>
                    <tr>
                        <td>体检提示信息</td>
                        <td>重要提示内容</td>
                    </tr>
                </table>
            </div>
           
            <!-- 图表区域 -->
            <div class="content-section">
                <h2 class="section-title">数据统计</h2>
               
                <!-- 第一行：两个图表 -->
                <div class="chart-row">
                    <!-- 用户访问来源 - 扇形图 -->
                    <div class="chart-box">
                        <h3 class="chart-title">用户访问来源</h3>
                        <div class="chart-wrapper" id="userSourceChart"></div>
                    </div>
                   
                    <!-- 季度统计 - 柱形图 -->
                    <div class="chart-box">
                        <h3 class="chart-title">季度体检统计</h3>
                        <div class="chart-wrapper" id="quarterChart"></div>
                    </div>
                </div>
               
                <!-- 第二行：两个图表 -->
                <div class="chart-row">
                    <!-- 体检项目统计 - 雷达图 -->
                    <div class="chart-box">
                        <h3 class="chart-title">体检项目统计</h3>
                        <div class="chart-wrapper" id="examItemChart"></div>
                    </div>
                   
                    <!-- 各店全年销售额 - 折线图 -->
                    <div class="chart-box">
                        <h3 class="chart-title">各店全年销售额</h3>
                        <div class="chart-wrapper" id="salesChart"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 初始化所有图表
        document.addEventListener('DOMContentLoaded', function() {
            // 用户访问来源 - 扇形图
            const userSourceChart = echarts.init(document.getElementById('userSourceChart'));
            const userSourceOption = {
                title: {
                    text: '用户访问来源',
                    subtext: '实时数据',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    orient: 'vertical',
                    left: 'left'
                },
                series: [
                    {
                        name: '访问来源',
                        type: 'pie',
                        radius: '50%',
                        data: [
                            { value: 1048, name: '搜索引擎' },
                            { value: 735, name: '直接访问' },
                            { value: 580, name: '邮件推广' },
                            { value: 484, name: '联盟广告' },
                            { value: 300, name: '视频广告' }
                        ],
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            };
            userSourceChart.setOption(userSourceOption);
           
            // 季度统计 - 柱形图
            const quarterChart = echarts.init(document.getElementById('quarterChart'));
            const quarterOption = {
                legend: {
                    data: ['第一季度', '第二季度', '第三季度', '第四季度']
                },
                tooltip: {},
                xAxis: {
                    type: 'category',
                    data: ['2019', '2020', '2021', '2022']
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        name: '第一季度',
                        type: 'bar',
                        data: [320, 332, 301, 334]
                    },
                    {
                        name: '第二季度',
                        type: 'bar',
                        data: [220, 182, 191, 234]
                    },
                    {
                        name: '第三季度',
                        type: 'bar',
                        data: [150, 232, 201, 154]
                    },
                    {
                        name: '第四季度',
                        type: 'bar',
                        data: [98, 132, 101, 134]
                    }
                ]
            };
            quarterChart.setOption(quarterOption);
           
            // 体检项目统计 - 雷达图
            const examItemChart = echarts.init(document.getElementById('examItemChart'));
            const examItemOption = {
                title: {
                    text: '体检项目统计'
                },
                legend: {
                    data: ['预算分配', '实际开销']
                },
                radar: {
                    indicator: [
                        { name: '常规体检', max: 6500 },
                        { name: '心血管检查', max: 16000 },
                        { name: '肿瘤筛查', max: 30000 },
                        { name: '骨密度检测', max: 38000 },
                        { name: '基因检测', max: 52000 }
                    ]
                },
                series: [
                    {
                        name: '预算 vs 实际',
                        type: 'radar',
                        data: [
                            {
                                value: [4200, 3000, 20000, 35000, 50000],
                                name: '预算分配'
                            },
                            {
                                value: [5000, 14000, 28000, 26000, 42000],
                                name: '实际开销'
                            }
                        ]
                    }
                ]
            };
            examItemChart.setOption(examItemOption);
           
            // 各店全年销售额 - 折线图
            const salesChart = echarts.init(document.getElementById('salesChart'));
            const salesOption = {
                color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'],
                title: {
                    text: '各店全年销售额'
                },
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'cross',
                        label: {
                            backgroundColor: '#6a7985'
                        }
                    }
                },
                legend: {
                    data: ['北京店', '上海店', '广州店', '深圳店', '成都店']
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: [
                    {
                        type: 'category',
                        boundaryGap: false,
                        data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
                    }
                ],
                yAxis: [
                    {
                        type: 'value'
                    }
                ],
                series: [
                    {
                        name: '北京店',
                        type: 'line',
                        stack: 'Total',
                        smooth: true,
                        lineStyle: {
                            width: 0
                        },
                        showSymbol: false,
                        areaStyle: {
                            opacity: 0.8,
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                {
                                    offset: 0,
                                    color: 'rgb(128, 255, 165)'
                                },
                                {
                                    offset: 1,
                                    color: 'rgb(1, 191, 236)'
                                }
                            ])
                        },
                        emphasis: {
                            focus: 'series'
                        },
                        data: [140, 232, 101, 264, 90, 340, 250, 210, 180, 220, 190, 230]
                    },
                    {
                        name: '上海店',
                        type: 'line',
                        stack: 'Total',
                        smooth: true,
                        lineStyle: {
                            width: 0
                        },
                        showSymbol: false,
                        areaStyle: {
                            opacity: 0.8,
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                {
                                    offset: 0,
                                    color: 'rgb(0, 221, 255)'
                                },
                                {
                                    offset: 1,
                                    color: 'rgb(77, 119, 255)'
                                }
                            ])
                        },
                        emphasis: {
                            focus: 'series'
                        },
                        data: [120, 282, 111, 234, 220, 340, 310, 290, 250, 270, 240, 260]
                    },
                    {
                        name: '广州店',
                        type: 'line',
                        stack: 'Total',
                        smooth: true,
                        lineStyle: {
                            width: 0
                        },
                        showSymbol: false,
                        areaStyle: {
                            opacity: 0.8,
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                {
                                    offset: 0,
                                    color: 'rgb(55, 162, 255)'
                                },
                                {
                                    offset: 1,
                                    color: 'rgb(116, 21, 219)'
                                }
                            ])
                        },
                        emphasis: {
                            focus: 'series'
                        },
                        data: [320, 132, 201, 334, 190, 130, 220, 210, 180, 190, 200, 210]
                    }
                ]
            };
            salesChart.setOption(salesOption);
           
            // 窗口大小变化时重新调整图表大小
            window.addEventListener('resize', function() {
                userSourceChart.resize();
                quarterChart.resize();
                examItemChart.resize();
                salesChart.resize();
            });
        });
    </script>
</body>
</html>
